home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 2002 November / SGI Freeware 2002 November - Disc 2.iso / dist / fw_gimp.idb / usr / freeware / include / libgimp / gimpsignal.h.z / gimpsignal.h
Encoding:
C/C++ Source or Header  |  2002-07-08  |  2.2 KB  |  67 lines

  1. /* LIBGIMP - The GIMP Library
  2.  * Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball
  3.  *
  4.  * This library is free software; you can redistribute it and/or
  5.  * modify it under the terms of the GNU Lesser General Public
  6.  * License as published by the Free Software Foundation; either
  7.  * version 2 of the License, or (at your option) any later version.
  8.  *
  9.  * This library is distributed in the hope that it will be useful,
  10.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12.  * Lesser General Public License for more details.
  13.  *
  14.  * You should have received a copy of the GNU Lesser General Public
  15.  * License along with this library; if not, write to the
  16.  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  17.  * Boston, MA 02111-1307, USA.
  18.  */
  19.  
  20. #ifndef __GIMP_SIGNAL_H__
  21. #define __GIMP_SIGNAL_H__
  22.  
  23. #include <signal.h>
  24.  
  25. #ifdef __cplusplus
  26. extern "C" {
  27. #endif /* __cplusplus */
  28.  
  29. /* For information look into the C source or the html documentation */
  30.  
  31.  
  32. /* A gimp-level interface to a Posix.1-compliant signal package lives here
  33.  * For 1.2, this gimp-level interface mostly passes through to posix calls
  34.  * without modification. Certain calls manipulate struct sigaction in
  35.  * ways useful to Gimp.
  36.  */
  37.  
  38. #ifdef __EMX__
  39. /* hope this is right for OS/2 */
  40. #define SA_RESTART SA_SYSV
  41. #endif
  42.  
  43. /* GimpSignalHandlerFunc is a reference to a (signal handler) function 
  44.  * that takes a signal ID and returns void. 
  45.  * signal(2) returns such references; so does gimp_signal_private.
  46.  */
  47. typedef void (* GimpSignalHandlerFunc) (gint signum);
  48.  
  49. /* Internal implementation that can be DEFINEd into various flavors of
  50.  * signal(2) lookalikes.
  51.  */
  52. GimpSignalHandlerFunc  gimp_signal_private (gint                   signum,
  53.                         GimpSignalHandlerFunc  handler,
  54.                         gint                   flags);
  55.  
  56. /* the gimp_signal_syscallrestart() lookalike looks like signal(2) but
  57.  * quietly requests the restarting of system calls. Addresses #2742
  58.  */
  59. #define gimp_signal_syscallrestart(signum,handler) gimp_signal_private ((signum), (handler), SA_RESTART)
  60.  
  61.  
  62. #ifdef __cplusplus
  63. }
  64. #endif /* __cplusplus */
  65.  
  66. #endif /* __GIMP_SIGNAL_H__ */
  67.